import http from './request.js'

/**
 * 获取用户信息
 */
export function getGoodsList({
  showCount,
  currentPage,
}) {

  return http.post('product/list', {
    showCount,
    currentPage,
  });
}
/**
 * 获取用户信息
 */
export function getAllGoodsList({
  name,
  sortType,
  showCount,
  currentPage,
}) {

  return http.post('product/list', {
    name,
    sortType,
    showCount,
    currentPage,
  });
}


/**
 * 获取用户信息
 */
export function getProduct({
  productId,
}) {

  return http.post('product/getProductInfo', {
    productId
  });
}

/**
 * 获取用户信息
 */
export function addCart({
  productId,
  size
}) {
  size =size||'1'
  return http.post('shopcar/addShopcar', {
    productId,
    size:String(size),
  });
}
/**
 * 获取购物车列表
 */
export function getCartList({
  showCount,
  currentPage,
}) {

  return http.get('shopcar/list', {
    showCount,
    currentPage,
  });
}


export function getShopInfo() {

  return http.get('user/getShopInfo', {
  });
}





/**
 * 获取用户信息
 */
export function getUser() {

  return http.post('user/getUser', {});
}

/**
 * 编辑用户信息
 */
export function editUser(params) {

  // "birth": "2022-01-01",
  // "avatar": "",
  // "name": "",
  // "phone": "",
  // "gender": "1 男  2女"
  return http.post('user/editUser', params);
}